#!/usr/bin/env python
# -*- coding:utf-8 -*-
import re
'''
inpp = '1-2*((60-30 +(-40-5)*(9-2*5/3 + 7 /3*99/4*2998 +10 * 568/14 )) - (-4*3)/ (16-3*2))'
inpp = re.sub('\s*','',inpp)    #\s去空格
new_content = re.split('\(([\+\-\*\/]?\d+[\+\-\*\/]?\d+){1}\)', inpp, 1)    #1,是对第一个进行分割
print new_content
'''
def compute(expression):
    pass

def excute(expression):
    if not re.search('\(([\+\-\*\/]*\d+\.*\d*){2,}\)',expression):
        final=compute(expression)
        return final
    content=re.search('\(([\+\-\*\/]*\d+\.*\d*){2,}\)',expression).group()
    before,nothing,after=re.split('\(([\+\-\*\/]*\d+\.*\d*){2,}\)',expression,1)
    content=content[1:len(content)-1]
    result=compute(content)
    new_expression="%s%s%s"%(before,result,after)
    return excute(new_expression)






